package day12;

import java.io.File;

public class delete {
    public static void main(String[] args) {
        File f=new File("E:\\cs_it heima\\aaa");
        boolean mkdir = f.mkdir();//创建单级目录
        System.out.println(mkdir);
        //boolean delete = f.delete();//删除文件
        //System.out.println(delete);
        boolean directory = f.isDirectory();//判断是否为文件夹
        System.out.println(directory);
        boolean file = f.isFile();//判断是否为文件
        System.out.println(file);
        boolean exists = f.exists();//判断文件是否存在
        System.out.println(exists);
        String name = f.getName();//获取文件名
        System.out.println(name);
        File[] files = f.listFiles();//将文件名用数组接收
        for (File file1 : files) {
            System.out.println(file1);
        }

        }


    }


